#include <string.h>
#include <iostream>
using std::cout;
using std::endl;

class Computer
{
public:
    Computer(const char * brand,double price)
    : _price(price)
    {
        strcpy(_brand,brand);
    }
 
    void print() //打印信息
    {
        cout << "brand:" << _brand << endl;
        cout << "price:" << _price << endl;
    }
private:
    //数据成员的名字前面加上下划线
    char _brand[20];
    double _price;
};

void test0(){
    Computer pc("hp",7000);
    pc.print();
    cout << sizeof(Computer) << endl;
}

int main(void){
    test0();
    return 0;
}
